package com.yzy.soft.system.domain;

import com.yzy.soft.system.domain.echarts.Data;

import java.util.ArrayList;
import java.util.List;

public class BusinesstreeToECharts {
    private int size;
    private List<String> nameList;
    private List<Data> data;

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public List<String> getNameList() {
        return nameList;
    }

    public void setNameList(List<String> nameList) {
        int size = nameList.size();
        int balance = 100 / size;
        List<Data> dataListTemp=new ArrayList<>();
        for (int i = 0; i < size; i++) {
            Data data = new Data();
            data.setName(nameList.get(i));
            data.setValue(balance);
            dataListTemp.add(data);
        }
        this.data=dataListTemp;
        this.nameList = nameList;
    }





    public List<Data> getData() {
        return data;
    }

    public void setData(List<Data> data) {

        this.data = data;
    }
}
